
<%@page import="ll.sms.web.*"%><%@ page language="java" import="java.util.*,ll.sms.pojo.*,org.json.simple.*" pageEncoding="UTF-8"%>
<%@page import="ll.sms.util.*"%>
<%


String sort = ParamUtils.getParameter(request,"sort");
String flag = ParamUtils.getParameter(request,"flag");
int index = ParamUtils.getIntParameter(request,"start",0);
int pageSize = ParamUtils.getIntParameter(request,"limit",15);
int currentPage = 1+(index/pageSize);
int total = WebBusinessImpl.getInstance().countTable("sms_admin","where arank = 2");

String dir = request.getParameter("dir");
if(dir == null){
	dir = "ASC";
}

String orderStr = null;
if(sort != null && !sort.equals("")){
	orderStr = " "+sort+" "+dir+" ";
}

List<SmsAdmin> list = WebBusinessImpl.getInstance().pageQuery(SmsAdmin.class,"sms_admin","where arank = 2",currentPage,pageSize,orderStr);


if("fuckcreator".equals(flag)){
if(list == null || list.size()==0){
	return;
}
List<SmsAdmin> nestlist= new ArrayList<SmsAdmin>();;
for (SmsAdmin sms : list){

	if(SmsAppContainer.getBlackList().containsKey(sms.getAid())){
			sms.setAavailable(-1);
	}else{
			sms.setAavailable(1);
	}
	nestlist.add(sms);
}
list = null;
list = nestlist;
}
String s = ExtJsonBuilder.toExtJsonString(total, list );
response.getWriter().print(s);
%>
